package com.cqq.auth.service;

import java.util.List;

import com.cqq.auth.service.bean.MenuBean;
import com.cqq.auth.service.bean.UrlBean;
import com.cqq.auth.service.exception.PermResourceServiceException;

/**
 * <h3>权限资源服务接口</h3>
 * 
 * @author xijq
 * @version 1.0.0
 * 
 */
public interface PermResourceService {

	/**
	 * <h3>添加菜单</h3>
	 * 
	 * @param menu MenuBean
	 * 
	 */
	public void addMenu(MenuBean menu) throws PermResourceServiceException;

	/**
	 * <h3>更新菜单</h3>
	 * 
	 * @param menu MenuBean
	 * 
	 */
	public void updateMenu(MenuBean menu) throws PermResourceServiceException;

	/**
	 * <h3>删除菜单</h3>
	 * 
	 * @param id 菜单ID
	 * 
	 */
	public void deleteMenu(Integer id) throws PermResourceServiceException;
	
	/**
	 * <h3>根据菜单链接查找用户菜单</h3>
	 * 
	 * @param url 菜单链接
	 * @param systemCode 系统代码
	 * 
	 * @return MenuBean
	 * 
	 */
	public MenuBean findMenuByUrl(String url, String systemCode);
	
	/**
	 * <h3>查询用户菜单</h3>
	 * 
	 * @param userId 用户ID
	 * @param systemCode 系统代码
	 * 
	 * @return MenuBean List
	 * 
	 */
	public List<MenuBean> listMenu(Integer userId, String systemCode);
	
	/**
	 * <h3>查询用户菜单</h3>
	 * 
	 * @param userId 用户ID
	 * @param systemCode 系统代码
	 * @param needAll 是否获取所有菜单，包括隐藏的菜单
	 * 
	 * @return MenuBean List
	 * 
	 */
	public List<MenuBean> listMenu(Integer userId, String systemCode, Boolean needAll);
	
	/**
	 * <h3>添加URL</h3>
	 * 
	 * @param url UrlBean
	 * 
	 */
	public void addUrl(UrlBean url) throws PermResourceServiceException;

	/**
	 * <h3>更新URL</h3>
	 * 
	 * @param url UrlBean
	 * 
	 */
	public void updateUrl(UrlBean url) throws PermResourceServiceException;
	
	/**
	 * <h3>删除URL</h3>
	 * 
	 * @param id URL ID
	 * 
	 */
	public void deleteUrl(Integer id) throws PermResourceServiceException;
	
	/**
	 * <h3>查询URL列表</h3>
	 * 
	 * @param systemCode 系统代码
	 * 
	 * @return UrlBean List
	 * 
	 */
	public List<UrlBean> listAllUrl(String systemCode);
	
	
	/**
	 * <h3>保存用户菜单配置</h3>
	 * 
	 * @param userId 用户ID
	 * @param menus 菜单配置列表
	 * 
	 */
	public void saveUserMenuConfig(Integer userId,List<MenuBean> menus,String systemCode) throws PermResourceServiceException;

}
